package com.gec.it.service;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Comment;
import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.Task;

public interface ApproveService {

	void removeDeploy(String id);

	public List<Deployment> findDeploys();

	public  void deploy(String name, InputStream inputStream);

	//查询是否已经开启过了
	public HistoricProcessInstance findHisProcByBizkey(String prockey,String bizkey);

	public ProcessInstance startWorkflow(String prockey, int bizkey, Map<String, Object> map);

	//根据流程key值和绑定的业务key值，查找流程图，用于显示流程图
	InputStream findImageInputStreamByBizkey(String processDefineKey, String bizkey);

	InputStream findImageInputStream(String deploymentId, String imageName);
	ProcessInstance findProcessInstanceByBizkey(String processDefineKey, String bizkey);

	//获取当前任务的图形坐标位置
	List<Map<String, Object>> findCoordingByBizkey(String processDefineKey, String bizkey);

	//查找个人用户应该处理的任务(包含各种流程图的)
	List<Task> findTaskListByName(String userkey);
	//查找个人用户应该处理的任务(指定流程图的)
	List<Task> findTaskListByName(String processDefineKey, String userkey);
	//根据任务把业务id找出来
	public String findBizkeyByTask(Task t);
	//查找组任务(不区分流程图)
	List<Task> findGroupTaskListByName(String userkey);
	//查找组任务(区分流程图)
	List<Task> findGroupTaskListByName(String processDefineKey, String userkey);
	//根据任务查询组任务成员
	List<IdentityLink> findGroupUsers(String taskid);
	//根据任务查询组任务成员名字
	List<String> findGroupUsersKey(String taskid);
	//返回流程出口连线的名称，我们控制按钮的名称
	List<String> findOutComeListByTaskId(String taskId);
	//根据id查询task对象
	public Task findTaskById(String taskid);

	Task saveSubmitTask(String taskId, String currentuser, String message, Map<String, Object> variables);

	void Group2User(String taskid, String currentuser);

	Task findTaskByProcessInstId(String processInstid);
	boolean isGroupUser(String taskId);

	boolean isGroupUser(Task task);

	//根据流程id查找批注
	List<Comment> findComment(String procInsId);
	//根据任务查找批注
	List<Comment> findCommentByTask(Task task);
	//根据任务id查找批注
	List<Comment> findCommentByTask(String taskId);
	//根据流程图key+业务id查找批注
	public List<Comment> findCommentByBizkey(String bizkey);

}
